import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import {CarouselComponent} from './carousel/carousel.component';
import {ClassifyComponent} from './classify/classify.component';
import {StoreComponent} from './store/store.component';
import {UserComponent} from './user/user.component';
import {LoginComponent} from './login/login.component';
import {LayoutComponent} from './layout/layout.component';
import {ExpressComponent} from './express/express.component';
import {ProductComponent} from './product/product.component';

const routes: Routes = [
  {path: 'login', component: LoginComponent},
  {path: 'layout', component: LayoutComponent, children: [
  { path: 'classify',  component: ClassifyComponent},
  { path: 'carousel', component: CarouselComponent },
  { path: 'store',  component: StoreComponent},
  { path: 'user', component: UserComponent },
      { path: 'express', component: ExpressComponent },
      { path: 'product', component: ProductComponent },
      {path: '**', component: CarouselComponent},
  ]},
  {path: '**', component: LoginComponent},
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
